#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <stdlib.h>
#include <unordered_map>
int main()
{
    int n;
    while (scanf("%d",&n)!=EOF) {

        std::unordered_map<int,int> set;
        for(int i = 0; i < n; i++)
        {
            int in;
            scanf("%d",&in);
            if(set.find(in)==set.end())
                set[in]=1;
            else{
                set[in]+=1;
            }
        }
        for(auto ite = set.begin(); ite!=set.end(); ite++){
            if(ite->second >= n/2+n%2){
                std::cout<<ite->first<<std::endl;
                break;
            }
        }
    }
    return 0;
}
